import axios from '@/request/http'

interface IBannerProps {
    items: any
    name: string
}

// 获取广告位列表
function getBannerList() {
    return axios.get('/api/rest/ads')
}

// 添加广告位
function addBannerList(params: IBannerProps) {
    return axios.post('/api/rest/ads', params)
}

// 获取广告位详情
function getBannerDetail(id: string) {
    return axios.get('/api/rest/ads/' + id)
}

// 编辑广告位状态
function putBannerDetail(id: string, params: any) {
    return axios.put('/api/rest/ads/' + id, params)
}

// 删除广告位
function delBannerItem(id: string) {
    return axios.delete('/api/rest/ads/' + id)
}

export {
    getBannerList,
    addBannerList,
    getBannerDetail,
    putBannerDetail,
    delBannerItem
}